import request from '@/utils/request'

export const list = function (data) {
  return request({
    url: '/api/user-service/user/search',
    method: 'get',
    params: data
  })
}
export const DEL = function (id) {
  return request({
    url: '/api/user-service/user/' + id,
    method: 'DELETE',
  })
}

// 工作量列表
export const worklist = function (data) {
  return request({
    url: '/api/user-service/user/searchUserWork',
    method: 'get',
    params: data
  })
}
// 时间工单列表
export const uesrWorkList = function (data) {
  return request({
    url: '/api/task-service/task/userWork',
    method: 'get',
    params: data
  })
}
//运维人员信息
export const userInfo = function (id) {
  return request({
    url: '/api/user-service/user/' + id,
    method: 'GET',
  })
}
// 角色选择列表
export const roleList = function () {
  return request({
    url: '/api/user-service/role',
    method: 'GET',
  })
}
//区域列表
export const regionList = function (data) {
  return request({
    url: '/api/vm-service/region/search',
    method: 'GET',
    params: data
  })
}
//添加人员
export const addUser = function (data) {
  return request({
    url: '/api/user-service/user',
    method: 'POST',
    data
  })
}
//修改人员
export const editUser = function (data) {
  return request({
    url: '/api/user-service/user/' + data.id,
    method: 'PUT',
    data
  })
}
//上传头像

export const addImg = function (data) {
  return request({
    url: '/api/vm-service/sku/fileUpload',
    method: 'POST',
    data
  })
}


// 对账管理
// 合作商汇总
export const partnerCollect = function (data) {
  return request({
    url: '/api/order-service/report/partnerCollect',
    method: 'GET',
    params: data
  })
}
//分成总数
export const totalBill = function (data) {
  return request({
    url: '/api/order-service/report/totalBill',
    method: 'GET',
    params: data
  })
}
//收入
export const orderAmount = function (data) {
  return request({
    url: '/api/order-service/report/orderAmount',
    method: 'GET',
    params: data
  })
}
//订单总数
export const orderCount = function (data) {
  return request({
    url: '/api/order-service/report/orderCount',
    method: 'GET',
    params: data
  })
}
//合作商列表
export const partnerList = function (data) {
  return request({
    url: '/api/user-service/partner/search',
    method: 'GET',
    params: data
  })
}
//人效运营/运维信息
export const taskReportInfo = function (data) {
  return request({
    url: `/api/task-service/task/taskReportInfo/${data.start}/${data.end}`,
    method: 'GET',
  })
}
//折线图数据
export const chartsInfo = function (data) {
  return request({
    url: `/api/task-service/task/collectReport/${data.start}/${data.end}`,
    method: 'GET',
  })
}
